package com.box.modules.report.controller;

import com.box.common.utils.PageUtils;
import com.box.common.utils.R;
import com.box.modules.report.entity.BoxRowProcessedEntity;
import com.box.modules.report.service.BoxRowProcessedService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Map;



/**
 * 原始数据处理表
 *
 * @author yangjs
 * @email catalpa65@163.com
 * @date 2020-10-29 16:09:38
 */
@RestController
@RequestMapping("report/boxrowprocessed")
public class BoxRowProcessedController {
    @Autowired
    private BoxRowProcessedService boxRowProcessedService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("report:boxrowprocessed:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = boxRowProcessedService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    @RequiresPermissions("report:boxrowprocessed:info")
    public R info(@PathVariable("id") Integer id){
		BoxRowProcessedEntity boxRowProcessed = boxRowProcessedService.getById(id);

        return R.ok().put("boxRowProcessed", boxRowProcessed);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("report:boxrowprocessed:save")
    public R save(@RequestBody BoxRowProcessedEntity boxRowProcessed){
		boxRowProcessedService.save(boxRowProcessed);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("report:boxrowprocessed:update")
    public R update(@RequestBody BoxRowProcessedEntity boxRowProcessed){
		boxRowProcessedService.updateById(boxRowProcessed);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("report:boxrowprocessed:delete")
    public R delete(@RequestBody Integer[] ids){
		boxRowProcessedService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
